package homeWork.SOC3.mission_extra.Animal;

import java.util.Scanner;

public class PetShop {

    private String name;
    private String type;
    private String variety;
    private int healthy;

    public PetShop() {
    }

    public void selectSystem() {
        //创建键盘录入对象
        Scanner sc = new Scanner(System.in);

        System.out.println("欢迎来到宠物店");

        //输入宠物名字
        System.out.print("请输入要领养宠物的名字:");
        this.name = sc.nextLine();

        //选择宠物类型
        System.out.print("请选择要领养的宠物类型: (1、狗狗 2、企鹅)");
        if (sc.nextInt() == 1) {
            this.type = "狗狗";
            //选择狗的品种
            System.out.print("请选择狗的品种: (1、聪明的拉布拉多犬 2、酷酷的雪纳瑞)");
            if (sc.nextInt() == 1) {
                this.variety = "聪明的拉布拉多犬";
            } else {
                this.variety = "酷酷的雪纳瑞";
            }
        } else {
            this.type = "企鹅";
        }

        //输入健康值
        System.out.print("请输入狗狗的健康值(1到100之间)");
        this.healthy = sc.nextInt();
        if (this.healthy >= 100 || this.healthy < 0) {
            this.healthy = 60;
            System.out.println("健康值应该在0和100之间，默认值是60");
        }

    }

    public void print(){
        System.out.println("宠物的自白:" + "\n" +
                            "我的名字叫" + name + ",我的健康值是" + healthy +
                                ",我和主人的亲密度是20" + ",我的类型是 " + variety);
    }

}
